package com.thinkwide.data.core;

import java.util.LinkedList;

public class MFListMap extends LinkedList<MFListData> {

    public void addData(String key, Object value) {
        MFListData data = new MFListData(key, value);
        this.add(data);
    }

    public boolean hasData(String key) {
        return findData(key) != null;
    }

    public MFListData findData(String key) {
        for (MFListData item : this) {
            if (MFString.compareNoCase(item.getKey(), key)) return item;
        }

        return null;
    }

    public Object findDataValue(String key) {
        MFListData item = findData(key);
        if (item != null)
            return item.getValue();
        else
            return null;
    }
}
